<%--
  Created by IntelliJ IDEA.
  User: ASUS
  Date: 2022/4/5
  Time: 21:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>展示所有</title>
    <script src="${pageContext.request.contextPath}/js/jquery-3.6.0.min.js"></script>
    <script>
        $(function(){
            $.ajax({
                type:'post',
                url:'${pageContext.request.contextPath}/userController/user',
                contentType:'application/json;charset=UTF-8',
                 async: true,
                 data: JSON.stringify({}),
                success:function(data){
                    var tab = $("#tab");
                    var str ="";
                    for(var i = 0;i<data.data.length;i++){
                            str += '<tr>'
                                        +'<td>'+ data.data[i].id+'</td>'
                                        +'<td>'+ data.data[i].username+'</td>'
                                        +'<td>'+ data.data[i].password+'</td>'
                                        +'<td>'+ data.data[i].email+'</td>'
                                        +'<td>'+ data.data[i].image+'</td>'
                                        +'<td>'+ data.data[i].status+'</td>'
                                        +'<td>'+ data.data[i].code+'</td>'
                                +'</tr>'
                        }
                    tab.append(str)
                    }
                });
        })
    </script>
</head>
<body>
    <table border="1" cellpadding="30" cellspacing="0" align="center" id="tab" >
         <tr>
              <td>id</td>
              <td>用户名</td>
              <td>密码</td>
              <td>email</td>
              <td>图片</td>
              <td>状态</td>
              <td>激活码</td>
           </tr>
    </table>
</body>
</html>
